package com.shareppy.norman.core.em;

import java.util.List;

import com.shareppy.norman.core.db.CursorWrapper;
import com.shareppy.norman.core.entity.AbstractEntity;
import com.shareppy.norman.core.queries.ComplexQuery;

public interface EntityManager {

	<E extends AbstractEntity> E save(E entity) throws Exception;

	// <E extends AbstractEntity> List<E> query(E entity, String queryName)
	// throws Exception;

	public <E extends AbstractEntity, R> CursorWrapper<?> raw_query(
			ComplexQuery<E, R> complexQuery) throws Exception;

	<E extends AbstractEntity, R> R query(ComplexQuery<E, R> complexQuery)
			throws Exception;

	<E extends AbstractEntity> E delete(E entity) throws Exception;

	<E extends AbstractEntity> void delete(List<E> entity) throws Exception;

	void release();

}
